using System;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;

namespace HengTong.Model._Admin;

public class SysDataPrivilege : TopBasePoco
{
    [Display(Name = "实体类型")]
    [Required]
    [StringLength(128)]
    public string EntityType { get; set; }  // 实体的完整类型名，如 "HengTong.Model.Db.Bill.SysDailyLeaveRequestBill"
    
    [Display(Name = "目标类型")]
    [Required]
    public DataPrivilegeTargetType TargetType { get; set; }  // 角色/岗位/部门
    
    [Display(Name = "目标ID")]
    [Required]
    public Guid TargetId { get; set; }  // 角色ID/岗位ID/部门ID
    
    [Display(Name = "权限范围")]
    [Required]
    public DataPrivilegeScope Scope { get; set; }  // 权限范围枚举
    
    [Display(Name = "自定义条件")]
    [StringLength(512)]
    public string CustomCondition { get; set; }  // 自定义的过滤条件（可选）
    
    [Display(Name = "优先级")]
    public int Priority { get; set; } = 0;  // 权限优先级，数值越大优先级越高
    
    [Display(Name = "是否启用")]
    public bool IsEnabled { get; set; } = true;
}